//
//  CheckGameChargeInfoResponse.m
//  EasyToo
//
//  Created by YuanDee on 13-10-13.
//
//

#import "CheckGameChargeInfoResponse.h"
#import "GameChargeInfo.h"

@implementation CheckGameChargeInfoResponse
- (void)parse
{
    [super parse];
    
    if (self.bodyDict)
    {
        NSArray *cardInfoArray = GetDictionaryArrayDefaultNil(self.bodyDict, @"card");
        NSLog(@"lanzhiyuan electricFeeInfoJson:%@\n", cardInfoArray);
        self.cardInfoArray = [[[NSMutableArray alloc] init] autorelease];
        if(cardInfoArray==nil)
        {
            NSDictionary *cardInfoJson2 = GetDictionaryDictionaryDefaultNil(self.bodyDict, @"card");
            GameChargeInfo *gameChargeInfo2 = [[GameChargeInfo alloc] initWithDictionary:cardInfoJson2];
            NSLog(@"lanzhiyuan electricFeeInfoJson2:%@\n", gameChargeInfo2);
            [self.cardInfoArray addObject:gameChargeInfo2];
            [gameChargeInfo2 release];
            
        }
        else
        {
            for (int i = 0; i < [cardInfoArray count]; i++)
            {
                NSDictionary *cardInfoJson = [cardInfoArray objectAtIndex:i];
                GameChargeInfo *gameChargeInfo = [[GameChargeInfo alloc] initWithDictionary:cardInfoJson];
                
                [self.cardInfoArray addObject:gameChargeInfo];
                [gameChargeInfo release];
            }
        }
    }
}

@end
